package com.smz.controller;

import com.smz.entity.TShipping;
import com.smz.service.TShippingService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@RestController
public class TShippingController {

    @Autowired
    private TShippingService tShippingService;

    @RequestMapping(value = "/tShipping",method = RequestMethod.POST)
    public String tShippingAddGgy(@RequestBody TShipping tShipping){
        tShippingService.save(tShipping);
        return "ok";
    }

    @ApiOperation("根据id查发货物流表")
    @GetMapping("/TShipping/{id}")
    public ResponseEntity<TShipping> findTShippingById(@PathVariable("id") int id){

        TShipping tShipping = tShippingService.getById(id);
        return ResponseEntity.ok(tShipping);
    }
}
